// @formatter:off
/**
 * @file c.rule.js
 * @author Alejandro Dario Simi
 * @date $Date: 2013-06-16 23:56:49 +0000 (Sun, 16 Jun 2013) $
 *
 * $Id: c.rule.js 73 2013-06-16 23:56:49Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0-BETA1/themes/default/templates/contents/c.rule.js $
 */

var ActionCreatorLinks = [];
<:OVER:list=ACTIONS-TYPES:/>ActionCreatorLinks["<:VAR:/>type<::/>"] = "<:VAR:/>creator<::/>";<::/>

function CreateAction() {
	var actionType = $("#ACTION_TYPE").val();
	if(actionType != "") {
		var action = "?action=<:VAR:/>WC_ACTION_CANVAS<::/>&saction="
			+ ActionCreatorLinks[actionType]
			+ "&group=<:VAR:/>GROUP-ID<::/>&rule=<:VAR:/>RULE-ID<::/>";
		document.location.href = action;
	} else {
		alert("You must choose a type of action");
		$("#ACTION_TYPE").focus();
	}
}

function EditName() {
	wcSimpleContainer.openUrl('simplecontainer.php?action=<:VAR:/>WC_SACTION_RULE_RENAME<::/>&group=<:VAR:/>GROUP-ID<::/>&rule=<:VAR:/>RULE-ID<::/>',SelfReload);
	return false;
}